package com.xcity.game.combat.skill.impl;

import com.xcity.game.combat.Action;
import com.xcity.game.combat.ActionEffect;
import com.xcity.game.combat.CombatUtils;
import com.xcity.game.combat.skill.CombatSkill;
import com.xcity.game.combat.unit.CombatUnit;
import com.xcity.game.common.GameStaticConfig;
import com.xcity.game.skill.Skill;

/**
 * 血口喷人<br/>
 * 对敌人目标造成{0=120#0}%技能伤害
 * @author yang.li
 *
 */
public class COMBAT_SKILL_90083 extends CombatSkill {

	public COMBAT_SKILL_90083(Skill skill) {
		super(skill);
	}
	
	@Override
	public void calcDamage(Action action) {
		CombatUnit source = action.unit;
		CombatUnit target = action.target.getDefenseUnit(action.unit.getIndex());
		if (target != null) {
			ActionEffect effect = action.addTarget(target);
			target = effect.getUnit(); // 修正目标
			float rate = skill.getParameter(0) / GameStaticConfig.percentBase;
			CombatUtils.calcMagicAttack(effect, rate);
		}
	}

}
